<include file="Inc/html_header" />
<div>
    <form name="addpage" method="post" action="<?php echo U('admin/admin_edit');?>">
        <input type="hidden" id="admin_id" name="admin_id" value="<?php echo $detail['admin_id'];?>" />
        <table class="table table-bordered table-hover">
            <thead>
                <tr>
                    <th colspan="2">修改用户</th>
                </tr>
            </thead>
            <tbody>
                <tr>
                    <td width="100" class="tdf">用户名称：</td>
                    <td><?php echo $detail['admin_name'];?></td>
                </tr>
                <tr>
                    <td class="tdf">用户密码：</td>
                    <td><input class="form-control form-focus input_text" type="password" id="admin_password" name="admin_password" size="40" /><span>&nbsp;不修改不用填写</span></td>
                </tr>
                <tr>
                    <td class="tdf">所属分组：</td>
                    <td class="mySelect">
                        <?php echo $groups;?>&nbsp;
                        <span style="cursor:pointer;" onclick="ops()" title="重新选择分组" id="re_op"><i class="icon icon-lock"></i></span>
                    </td>
                </tr>
                <tr>
                    <td class="tdf" valign="top">用户权限：</td>
                    <td>
                        <div class="node_list"><?php echo $nodes;?></div>
                    </td>
                </tr>
                <tr>
                    <td class="tdf">&nbsp;</td>
                    <td>
                        <input type="checkbox" id="cka" onclick="checkAll(this, 'auth[]')" />全选&nbsp;&nbsp;&nbsp;
                        <input type="submit" value="修改" class="btn btn-primary" />
                        <input type="button" value="返回" class="btn" onclick="backStep();" />
                    </td>
                </tr>
            </tbody>
        </table>
    </form>
</div>
<script type="text/javascript">
function ops()
{
    var obj = $('#re_op');
    if(obj.children('i').hasClass('icon-lock')){
        $('#admin_group_id').attr('disabled', false);
        obj.attr('title', '锁定分组');
        obj.children('i').removeClass('icon-lock').addClass('icon-unlock-alt');
    }else{
        $('#admin_group_id').attr('disabled', true);
        obj.attr('title', '重新选择分组');
        obj.children('i').removeClass('icon-unlock-alt').addClass('icon-lock');
    }
}
$(function(){
    $(document).on('click', '.cb', function(){
        var flag = false;
        if($(this).is(':checked')){ flag = true; }
        var cbs = $(this).parent().find('input[type="checkbox"]');
        for(var i in cbs){ cbs[i].checked = flag; }
    });
});
//得到分组的权限
function getGroupAcl(group_id)
{
    $.ajax({
        url:'/admin/ajax_get_nodes_checkbox',
        data:({'group_id':group_id}),
        dataType:'json',
        success:function(msg){
            $('.node_list').html($(msg.htm));
        }
    })
}
</script>
<include file="Inc/html_footer" />